package main

import (
	"fmt"
	"gorm-study/src/pkg/student/models"
	"gorm-study/src/pkg/utils/dbutil"
)

func main() {
	var students []models.Student
	params := map[string]interface{}{
		"Age":    24,
		"Gender": false,
	}
	result := dbutil.DB.Where(params).Find(&students) // 传指针

	fmt.Printf("result.RowsAffected：%v \n", result.RowsAffected)
	for _, student := range students {
		fmt.Printf("Name:%v, Age:%v, Gender:%v \n", student.Name, student.Age, student.Gender)
	}
}
